<template>
  <!-- 歌曲歌手卡片 -->
  <div class="player" v-if="song">
    <div class="player_cover">
      <div class="player_cover_left" @mouseenter="isCover = true" @mouseleave="isCover = false" @click="showPure">
        <el-avatar shape="square" :size="60" class="avatar">
          <img :src="song.pic || song.picUrl" />
          <b-mask icon="iconfont icon-zuidahua" size="36px" v-if="isCover" />
        </el-avatar>
      </div>
      <div class="player_covter_content">
        <div class="player_covter_title">{{ song.name }}</div>
        <div class="player_covter_article">{{ song.artist }}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isCover: false
    }
  },
  props: {
    song: {
      type: Object,
      default: () => {}
    }
  },
  methods: {
    showPure() {
      this.$parent.isPure = true
    }
  }
}
</script>

<style lang="less" scoped>
.player {
  display: flex;
  .player_cover {
    position: absolute;
    left: 0;
    top: -100px;
    z-index: 9;
    width: 160px;
    height: 100px;
    padding: 10px;
    display: flex;
    align-items: center;
    .player_cover_left {
      width: 60px;
      height: 60px;
      .avatar {
        position: relative;
      }
    }
    .player_covter_content {
      margin-left: 10px;
      height: 60px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .player_covter_title {
        font-size: 14px;
        color: #000;
        font-weight: 800;
      }
      .player_covter_article {
        font-size: 14px;
        color: #000;
      }
    }
  }
}
</style>
